package com.xinke.module.system.api.permission;

import com.xinke.component.common.pojo.Result;
import com.xinke.module.system.api.permission.dto.DeptDataPermissionRespDTO;
import com.xinke.module.system.service.permission.PermissionService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Collection;
import java.util.Set;

/**
 * @Author yzx
 * @CreateTime 2025/4/3 22:20
 * @Version 1.0
 * @Description: // 提供 RESTful API 接口，给 Feign 调用
 */
@RestController
@Validated
public class PermissionApiImpl implements PermissionApi{

    @Resource
    private PermissionService permissionService;

    @Override
    public Result<Set<Long>> getUserRoleIdListByRoleIds(Collection<Long> roleIds) {
        return null;
    }

    @Override
    public Result<Boolean> hasAnyPermissions(Long userId, String... permissions) {
        return Result.success(permissionService.hasAnyPermissions(userId,permissions));
    }

    @Override
    public Result<Boolean> hasAnyRoles(Long userId, String... roles) {
        return null;
    }

    @Override
    public Result<DeptDataPermissionRespDTO> getDeptDataPermission(Long userId) {
        return null;
    }
}
